<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
	// 	$(document).ready(function() {                           // When the HTML DOM is ready loading, then execute the following function...
	// 	    $('#somebutton').click(function() {                  // Locate HTML DOM element with ID "somebutton" and assign the following function to its "click" event...
	// 	        $.get('/myList/AjaxServlet', function(responseJson) {    // Execute Ajax GET request on URL of "someservlet" and execute the following function with Ajax response JSON...
	// 	            var $ul = $('<ul>').appendTo($('#somediv')); // Create HTML <ul> element and append it to HTML DOM element with ID "somediv".
	// 	            $.each(responseJson, function(index, item) { // Iterate over the JSON array.
	// 	                $('<li>').text(item).appendTo($ul);      // Create HTML <li> element, set its text content with currently iterated item and append it to the <ul>.
	// 	            });
	// 	        });
	// 	    });
	// 	});

	function display(list) {

		alert("pouet");
		jQuery.ajax({
			type : 'GET', // Le type de ma requete
			url : '/myList/AjaxServlet', // L'url vers laquelle la requete sera envoyee
			data : {
				listId : list
			},
			success : function(data, textStatus, jqXHR) {
				// La reponse du serveur est contenu dans data
				// On peut faire ce qu'on veut avec ici
			},
			error : function(jqXHR, textStatus, errorThrown) {
				// Une erreur s'est produite lors de la requete
			}
		});
	}
</script>
</head>
<body>
	<h1>test en JQuery</h1>
	<button id="somebutton">press here</button>
	<div id="somediv"></div>
	<h2>test2</h2>
	<span onclick="display(1);" >lala</span>
</body>
</html>